#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>

int main(void)
{
	int fd = open("/dev/fb0", O_RDWR);
	unsigned int *lcd = mmap(NULL, 800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
	

	FILE *file = fopen("./283.bmp", "r");
	char buf[54];
	int ret = fread(buf, 54, 1, file);

	char tmp[200*100*3];
	fread(tmp, 200*100,3, file);

	
	unsigned int *p=lcd;
	unsigned char *t=tmp;
	int i=0, j=0;
	for(i=0;i<100; i++)
	{
		for(j=0; j<200; j++)
		{
			memcpy(p+j, t+j*3, 3);	
		}
		p+=800;
		t+=200*3;
	}
	
	munmap(lcd, 800*480*4);
	close(fd);
	fclose(file);


	return 0;
}
